/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.openbrew.openbrewrf;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author chapmand
 */
@Entity
@Table(name = "ReturnedBeer")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "ReturnedBeer.findAll", query = "SELECT r FROM ReturnedBeer r"),
    @NamedQuery(name = "ReturnedBeer.findByRetID", query = "SELECT r FROM ReturnedBeer r WHERE r.retID = :retID"),
    @NamedQuery(name = "ReturnedBeer.findByRetCustID", query = "SELECT r FROM ReturnedBeer r WHERE r.retCustID = :retCustID"),
    @NamedQuery(name = "ReturnedBeer.findByRetBeerID", query = "SELECT r FROM ReturnedBeer r WHERE r.retBeerID = :retBeerID"),
    @NamedQuery(name = "ReturnedBeer.findByRetDate", query = "SELECT r FROM ReturnedBeer r WHERE r.retDate = :retDate"),
    @NamedQuery(name = "ReturnedBeer.findByRetNotes", query = "SELECT r FROM ReturnedBeer r WHERE r.retNotes = :retNotes"),
    @NamedQuery(name = "ReturnedBeer.findByRetFGIQty", query = "SELECT r FROM ReturnedBeer r WHERE r.retFGIQty = :retFGIQty")})
public class ReturnedBeer implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "RetID")
    private Integer retID;
    @Basic(optional = false)
    @NotNull
    @Column(name = "RetCustID")
    private int retCustID;
    @Basic(optional = false)
    @NotNull
    @Column(name = "RetBeerID")
    private int retBeerID;
    @Basic(optional = false)
    @NotNull
    @Column(name = "RetDate")
    @Temporal(TemporalType.DATE)
    private Date retDate;
    @Basic(optional = false)
    @NotNull
    @Size(min = 0, max = 250)
    @Column(name = "RetNotes")
    private String retNotes;
    @Basic(optional = false)
    @NotNull
    @Column(name = "RetFGIQty")
    private int retFGIQty;
    @JoinColumn(name = "RetFGIID", referencedColumnName = "FGIID")
    @ManyToOne(optional = false)
    private FinishedGoodsInventory retFGIID;

    public ReturnedBeer() {
    }

    public ReturnedBeer(Integer retID) {
        this.retID = retID;
    }

    public ReturnedBeer(Integer retID, int retCustID, int retBeerID, Date retDate, String retNotes, int retFGIQty) {
        this.retID = retID;
        this.retCustID = retCustID;
        this.retBeerID = retBeerID;
        this.retDate = retDate;
        this.retNotes = retNotes;
        this.retFGIQty = retFGIQty;
    }

    public Integer getRetID() {
        return retID;
    }

    public void setRetID(Integer retID) {
        this.retID = retID;
    }

    public int getRetCustID() {
        return retCustID;
    }

    public void setRetCustID(int retCustID) {
        this.retCustID = retCustID;
    }

    public int getRetBeerID() {
        return retBeerID;
    }

    public void setRetBeerID(int retBeerID) {
        this.retBeerID = retBeerID;
    }

    public Date getRetDate() {
        return retDate;
    }

    public void setRetDate(Date retDate) {
        this.retDate = retDate;
    }

    public String getRetNotes() {
        return retNotes;
    }

    public void setRetNotes(String retNotes) {
        this.retNotes = retNotes;
    }

    public FinishedGoodsInventory getRetFGIID() {
        return retFGIID;
    }

    public void setRetFGIID(FinishedGoodsInventory retFGIID) {
        this.retFGIID = retFGIID;
    }

    public int getRetFGIQty() {
        return retFGIQty;
    }

    public void setRetFGIQty(int retFGIQty) {
        this.retFGIQty = retFGIQty;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (retID != null ? retID.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof ReturnedBeer)) {
            return false;
        }
        ReturnedBeer other = (ReturnedBeer) object;
        if ((this.retID == null && other.retID != null) || (this.retID != null && !this.retID.equals(other.retID))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.openbrew.openbrewrf.ReturnedBeer[ retID=" + retID + " ]";
    }
    
}
